import request from '../utils/request.js'

export default {
    //获取关注数
    SubmitFollowCount(uid){
        return request({
            method:'get',
            url:`/userservice/follow/countFollow?uid=${uid}`
        })
    },
    //获取粉丝数
    SubmitFollowFansCount(fid){
        return request({
            method:'get',
            url:`/userservice/follow/countFollow?fid=${fid}`
        })
    },
    //根据用户id查询用户收藏数
    SubmitByUserIdGetCollectNum(uid){
        return request({
            method: 'get',
            url: `/userservice/collect/countCollect?uid=${uid}`,
        })
    },
    //根据用户id查询收藏视频信息
    SubmitByUserIdGetCollect(page,pageSize,uid){
        return request({
            method: 'get',
            url: `/userservice/collect/queryPageCollectVideo?page=${page}&pageSize=${pageSize}&uid=${uid}`,
        })
    },
    //用户取消收藏
    SubmitDeleteCollect(collect){
        return request({
            method: 'delete',
            url: `/userservice/collect/deleteCollect`,
            data:collect
        })
    },
    //用户查看粉丝
    SubmitByUserIdGetFans(page,pageSize,fid){
        return request({
            method: 'get',
            url: `/userservice/follow/queryFans?page=${page}&pageSize=${pageSize}&fid=${fid}`,
        })
    },
    //根据用户id和关注的用户id取消关注
    SubmitDeleteRegard(follow){
        return request({
            method: 'post',
            url: `/userservice/follow/addOrDeleteFollow`,
            data:follow
        })
    },
    //根据用户id查询关注用户的id
    SubmitByUserIdGetRegard(page,pageSize,uid){
        return request({
            method: 'get',
            url: `/userservice/follow/queryFollow?page=${page}&pageSize=${pageSize}&uid=${uid}`,
        })
    },
    //获取历史记录
    SubmitByUidGetHistory(page,pageSize,uid){
        return request({
            method:'get',
            url:`/userservice/history/queryHistoryVideoVO?page=${page}&pageSize=${pageSize}&uid=${uid}`
        })
    },
    //删除历史记录
    SubmitDeleteHistory(history){
        return request({
            method: 'delete',
            url: `/userservice/history/deleteHistory`,
            data:history
        })
    },
    //关注用户
    SubmitFollow(data){
        return request({
            method: 'post',
            url: `/userservice/follow/addOrDeleteFollow`,
            data:data
        })
    },
    //删除评论
    SubmitDeleteComment(comment){
        return request({
            method: 'delete',
            url: `/userservice/comment/deleteComment`,
            data:comment
        })
    },
    //评论
    SubmitComment(comment){
        return request({
            method: 'post',
            url: `/userservice/comment/addComment`,
            data:comment
        })
    },
    //收藏
    SubmitCollect(data){
        return request({
            method: 'post',
            url: `/userservice/collect/addCollect`,
            data:data
        })
    },
    //点赞
    SubmitLike(data){
        return request({
            method: 'post',
            url: `/userservice/like/addOrDeleteLike`,
            data:data
        })
    },
    //查询是否点赞
    SubmitLikeNotNull(uid,vid){
        return request({
            method: 'get',
            url: `/userservice/like/isLike?uid=${uid}&vid=${vid}`,
        })
    },
    //查询是否收藏
    SubmitCollectNotNull(uid,vid){
        return request({
            method: 'get',
            url: `/userservice/collect/isCollect?uid=${uid}&vid=${vid}`,
        })
    },
    //根据视频id查询收藏数
    SubmitGetCollectByVid(vid){
        return request({
            method: 'get',
            url: `/userservice/collect/countVideo/${vid}`,
        })
    },
    //根据视频id查询点赞数
    SubmitGetLikeByVid(vid){
        return request({
            method: 'get',
            url: `/userservice/like/countVideo/${vid}`,
        })
    },
    //查询是否关注
    SubmitGetByUidFid(uid,fid){
        return request({
            method: 'get',
            url: `/userservice/follow/isFollow?uid=${uid}&fid=${fid}`,
        })
    },
    //查询评论
    SubmitGetComment(page,pageSize,comment){
        return request({
            method: 'post',
            url: `/userservice/comment/queryPageComment`,
            data:{
                page:page,
                pageSize:pageSize,
                queryInfo:comment
            }
        })
    },
    //添加历史记录
    SubmitHistory(data){
        return request({
            method: 'post',
            url: `/userservice/history/addHistory`,
            data:data
        })
    },
    //根据token查看关注粉丝收藏发布数
    SubmitCountById(){
        return request({
            method: 'get',
            url: `/userservice/personalCenter/countInfoByUser`
        })
    }
}